/*
 * @Author: your name
 * @Date: 2021-03-11 15:53:18
 * @LastEditTime: 2021-03-12 10:26:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ui-demo\src\api\user.js
 */
import request from '@/api/request'

const api = '/app/user/'

export function login (data) {
  return request({
    url: api + 'login',
    method: 'post',
    data
  })
}

export function addUser (data) {
  return request({
    url: api,
    method: 'post',
    data
  })
}

export function editUser (userId, data) {
  return request({
    url: api + userId,
    method: 'put',
    data: data
  })
}

export function delUser (userId) {
  return request({
    url: api + userId,
    method: 'delete'
  })
}

export function searchList (query) {
  return request({
    url: api + '/list',
    method: 'get',
    params: query
  })
}
